﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BUS;
using DAO;

namespace final.wuc
{
    public partial class wucdangtour : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void imgsubmit_Click(object sender, ImageClickEventArgs e)
        {
            TourBUS tourBus = new TourBUS();
            TTOUR t_tour = new TTOUR();

            t_tour.TourName = txtName.Text;
            //t_tour.TourPlace = ddlDestination;
            t_tour.TourTime = txtDuration.Text;
            t_tour.TourPrice = txtPrice.Text;
            t_tour.TourHighLights = txtHighlights.Text;
            t_tour.TourCondition = autoFill(txtCondition.Text);
            t_tour.TourInfo = autoFill(txtInfo.Text);

            if (tourBus.addTour(t_tour))
            {
                Response.Redirect("~/home.aspx");
            }
        }

        private string autoFill(string p)
        {
            if (p == "")
            {
                return "không có";
            }
            return p;
        }
    }
}